/* eslint-disable max-classes-per-file */
/*
 * @Description:
 * @Version: 2.0
 * @Autor: wiz
 * @Date: 2023-08-16 17:36:20
 * @LastEditors: wiz
 * @LastEditTime: 2023-12-16 11:17:48
 */
import { N_oSetupPanel } from '../../types';
import { T_compPanelConf } from '../compConfPanel';
import { T_compBase } from './compBase';

// type I_tableStyle = N_oSetupPanel.N_comps.I_tableStyle;
// type I_compToolbar = N_oSetupPanel.N_comps.I_compToolbar;
type I_messageConf = N_oSetupPanel.N_comps.I_messageConf;

export class T_refCompConf {
  name: string;

  comment: string;

  isCreated: boolean;

  status: string;

  refComps: Array<{ value: string }>;

  messageConfig: I_messageConf;
}
export class T_refComp extends T_compBase {
  public conf: T_refCompConf = new T_refCompConf();

  // private TtoolbarLib: T_toolbarLib = new T_toolbarLib();

  private TcompPanelConf: T_compPanelConf = new T_compPanelConf();

  constructor() {
    super();
    this.conf = {
      name: '',
      comment: '',
      isCreated: false,
      status: '',
      refComps: [],
      messageConfig: {
        custDefListener: {
          search: [],
          coordination: null
        },
        emitActions: {
          search: [],
          refresh: []
        },
        eventGroup: null
      }
    };
  }

  public getConf(): T_refCompConf {
    return this.conf;
  }

  public getComponentId(): N_oSetupPanel.N_comps.COMP_MODULE_ID {
    return N_oSetupPanel.N_comps.COMP_MODULE_ID.REF_COMP;
  }

  public GetCompPanelConf(): N_oSetupPanel.N_comps.I_setupPanel {
    return this.TcompPanelConf.getCompPanelSet(
      N_oSetupPanel.N_comps.COMP_NAME.REF_COMP
    );
  }

  public getPermissionList(
    config: T_refCompConf
  ): Array<N_oSetupPanel.I_permission> {
    return [];
  }
}
